package com.fymxy.question_bank_management.mapper;

import com.fymxy.question_bank_management.pojo.Manager;

import java.util.List;

import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;
//import sun.misc.Contended;

@Mapper
@Component
public interface ManagerMapper {
    @Update("update manager set manager_name=#{name} where manager_no=#{No} ")
    public int update(int No, String name);

    int deleteByPrimaryKey(Integer managerNo);

    int insert(Manager record);

    int insertSelective(Manager record);


    Manager selectByPrimaryKey(Integer managerNo);


    int updateByPrimaryKeySelective(Manager record);

    int updateByPrimaryKey(Manager record);

    @Select("select manager_no,manager_nickname,manager_name,manager_pwd from manager where manager_nickname = #{username} and manager_pwd = #{password}")
    @Results(id = "managerMap",value = {
            @Result(column = "manager_no",property = "managerNo",id = true),
            @Result(column = "manager_name",property = "managerName"),
            @Result(column = "manager_pwd",property = "managerPwd"),
            @Result(column = "manager_nickname",property = "managerNickname")
    })
    Manager managerLogin(String username, String password);
}